home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
MAC
/
THINKC
/
4_0
/
FIX_DESK
/
SOURCE
/
OPTIONS.C
< prev
next >
Wrap
C/C++ Source or Header
|
1988-09-07
|
2KB
|
64 lines
#include <MacTypes.h>
#include <QuickDraw.h>
#include <WindowMgr.h>
#include <ControlMgr.h>
#include <DialogMgr.h>
#include "fix.h"
enum {
ITEM_OPTIONS_OK = 1,
ITEM_OPTIONS_CANCEL,
ITEM_OPTIONS_COMMENTS = 4,
ITEM_OPTIONS_BUNDLES,
ITEM_OPTIONS_APPLLIST
};
/* Handle the option selection dialog. */
void do_options()
{
register DialogPtr options_dialog;
int item, done;
Handle comment_item,bundle_item, appl_item;
options_dialog = GetNewDialog(DIALOG_OPTIONS, NIL, MINUS_ONE);
comment_item = get_item(options_dialog, ITEM_OPTIONS_COMMENTS);
bundle_item = get_item(options_dialog, ITEM_OPTIONS_BUNDLES);
appl_item = get_item(options_dialog, ITEM_OPTIONS_APPLLIST);
SetCtlValue(comment_item, process_comments);
SetCtlValue(bundle_item, process_bundles);
SetCtlValue(appl_item, process_appls);
ShowWindow(options_dialog);
done = 0;
do {
ModalDialog(NIL, &item);
switch (item) {
case ITEM_OPTIONS_OK:
process_comments = GetCtlValue(comment_item);
process_bundles = GetCtlValue(bundle_item);
process_appls = GetCtlValue(appl_item);
if (process_comments || process_bundles || process_appls)
done = 1;
else
Alert(ALERT_OPTIONS, NIL);
break;
case ITEM_OPTIONS_CANCEL:
done = 1;
break;
case ITEM_OPTIONS_COMMENTS:
case ITEM_OPTIONS_BUNDLES:
case ITEM_OPTIONS_APPLLIST:
{
register Handle whatever;
whatever = get_item(options_dialog, item);
SetCtlValue(whatever, !GetCtlValue(whatever));
}
break;
}
} while (!done);
DisposDialog(options_dialog);
}